package project.innovation.mooddiagnosis.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import project.innovation.mooddiagnosis.entity.file.ChunkInfo;

import java.util.List;

public interface ChunkMapper {
    @Select("SELECT * FROM chunk where c_md5 = #{md5}")
    List<ChunkInfo> selectChunkListByMd5(String md5);

    @Insert("INSERT INTO chunk values (#{chunkId}, #{md5}, #{index})")
    Integer insertChunk(ChunkInfo chunkInfo);

    @Delete("DELETE from chunk where c_md5 = #{md5}")
    void deleteChunkByMd5(String md5);
}
